<?

class Admin_Spam extends MY_Controller {

    function Admin_Spam() {

        parent::MY_Controller(TRUE);

    }

    function index() {

        if ($this->input->post('btn_submit_spam_action')) {

            if ($this->input->post('mass_spam_actions') == 'delete_selected') {

                $this->mdl_comments->delete_multiple();

            }

            elseif ($this->input->post('mass_spam_actions') == 'not_spam') {

                $this->mdl_comments->not_spam_multiple();

            }

        }

        elseif ($this->input->post('btn_delete_all_spam')) {

            $this->mdl_comments->delete_all_spam();

        }

        $this->mdl_sessions->set_last_index();

        $this->load->view('admin/spam_index');

    }

    function not_spam() {

        $this->mdl_comments->not_spam();

        redirect($this->session->userdata('last_index'));

    }

    function delete() {

        $this->mdl_comments->delete();

        redirect($this->session->userdata('last_index'));

    }

}

?>